﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using Oracle.DataAccess.Client;

namespace DbHelper.Driver
{
    public class OracleDriver : IDriver
    {
        OracleConnection connection;
        OracleCommand command;
        OracleDataAdapter dataAdapter;
        OracleCommandBuilder commandBuilder;


        public void Connect(string connectionString)
        {
            connection = new OracleConnection(connectionString);
            command = connection.CreateCommand();
            dataAdapter = new OracleDataAdapter(command);
            commandBuilder = new OracleCommandBuilder(dataAdapter);
        }

        public IDriver CreateInstance()
        {
            return new MySQLDriver();
        }

        public IDbConnection DbConnection
        {
            get { return connection; }
        }

        public IDbCommand DbCommand
        {
            get { return command; }
        }

        public IDbDataAdapter DbDataAdapter
        {
            get { return dataAdapter; }
        }
    }
}
